package zust.study.io;

import java.io.File;
import java.io.IOException;

public class Demo01_File {

    public static void createFile() throws IOException {
        File file = new File("C:/files/Java/IO/demo1.txt");
        file.createNewFile();
        file.mkdirs();
        System.out.println("文件名:\t" + file.getName());
        System.out.println("parent:\t" + file.getParent());
        System.out.println("Path:\t" + file.getPath());
        System.out.println("CanonicalPath:\t" + file.getCanonicalPath());
        System.out.println("该盘分区大小:\t" + file.getTotalSpace()/(1024*1024*1024) + "G");

    }

    public static void main(String[] args) {
        try {
            createFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
